package com.woniuxy.vue.mapper;
import com.woniuxy.vue.controller.dto.UserAddressDto;
import com.woniuxy.vue.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
 * @Author: linKe
 * @Date: 2021/11/23 23:24
 * @FileName: UserMapper
 * @version: 1.0
 * @Description: 描述
 */
public interface UserMapper extends BaseMapper<User> {
    /**
     *  // 一对多查询
     * @param page  页面
     * @param nickName  昵称
     * @return  地址视图对象
     */
    Page<User> findPage(Page<User> page, @Param("nickName") String nickName);

    @Select("select count(id) count, address from user GROUP BY address")
    List<UserAddressDto> countAddress();

}

